import mockjs from 'mockjs';
import { delay } from 'roadhog-api-doc';
import defaultSettings from '@/defaultSettings';

//
const proxy = {
  'POST /tangram/process/queryVersionData': (req, res) => {
    res.status(200).send({
      resultCode: '0',
      resultData: {
        dataSourceType: 'None', // 开始节点的类型，'Http' | 'None'
        nodes: [
          {
            type: 'node',
            size: '80*48',
            shape: 'flow-rect',
            color: '#1890FF',
            label: '校验器33校验器33校验器33',
            x: 308.671875,
            y: 203,
            id: '960412d1',
            index: 0,
            nodeCode: '1111_transformer_xxx',
          },
          {
            type: 'node',
            size: '72*72',
            shape: 'flow-circle',
            color: '#FA8C16',
            label: '输入',
            x: 124.671875,
            y: 192,
            id: 'e3616777',
            index: 1,
          },
          {
            type: 'node',
            size: '80*72',
            shape: 'flow-rhombus',
            color: '#13C2C2',
            label: '转换器',
            x: 480.671875,
            y: 208,
            id: '2d55f36c',
            index: 2,
          },
          {
            type: 'node',
            size: '80*48',
            shape: 'flow-capsule',
            color: '#722ED1',
            label: '输出',
            x: 692.671875,
            y: 218,
            id: '26445736',
            index: 3,
          },
        ],
        edges: [
          {
            source: 'e3616777',
            sourceAnchor: 1,
            target: '960412d1',
            targetAnchor: 3,
            id: 'ae9a34b4',
            index: 4,
          },
          {
            source: '960412d1',
            sourceAnchor: 1,
            target: '2d55f36c',
            targetAnchor: 3,
            id: '40e44b08',
            index: 5,
            branch: 'VALIDATE_SUCCESS',
          },
          {
            source: '2d55f36c',
            sourceAnchor: 1,
            target: '26445736',
            targetAnchor: 3,
            id: '83930f4b',
            index: 6,
          },
        ],
      },
    });
  },
};

export default delay(proxy, defaultSettings.delay);
